# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=signon-plugin-oauth2
pkgver=0.25_git20231124
pkgrel=0
_commit="fab698862466994a8fdc9aa335c87b4f05430ce6"
arch="all"
url="https://gitlab.com/accounts-sso/signon-plugin-oauth2"
pkgdesc="Signond OAuth 1.0 and 2.0 plugin"
license="LGPL-2.1-only"
makedepends="
	qt6-qtbase-dev
	signond-dev
	"
#source="https://gitlab.com/accounts-sso/signon-plugin-oauth2/-/archive/VERSION_$pkgver/signon-plugin-oauth2-VERSION_$pkgver.tar.gz
source="https://gitlab.com/accounts-sso/signon-plugin-oauth2/-/archive/$_commit/signon-plugin-oauth2-$_commit.tar.gz"
subpackages="$pkgname-dev"
#builddir="$srcdir/$pkgname-VERSION_$pkgver"
builddir="$srcdir/$pkgname-$_commit"

prepare() {
	default_prepare

	# Don't install tests and example
	echo 'INSTALLS =' >> tests/tests.pro
	echo 'INSTALLS =' >> example/example.pro
}

build() {
	/usr/lib/qt6/bin/qmake \
		PREFIX=/usr \
		LIBDIR=/usr/lib
	CPPFLAGS="$CPPFLAGS -Wno-error" make
}

check() {
	make check
}

package() {
	INSTALL_ROOT="$pkgdir" make install
}

sha512sums="
2e921bd31b1e58d78f0aaa5ff4a8c7ca78661d64f88a75e9c769c0d850e4ba87a8064a2c2bdfe7acc347ac7ed6cd82991290222374e1a74a78fae4e6f2cdf49e  signon-plugin-oauth2-fab698862466994a8fdc9aa335c87b4f05430ce6.tar.gz
"
